import uuid as uuid
from django.db import models
from django.db.models import Max


class Userinfo(models.Model):
    """
    用户信息表
    """
    id = models.AutoField("id", unique=True, primary_key=True)
    account = models.CharField("用户账号", max_length=20, null=False)
    username = models.CharField("用户名", max_length=20, null=False)
    password = models.CharField("密码", max_length=20, null=False)
    token = models.TextField("token", max_length=500, default=0)
    token_time = models.DateTimeField("token生成时间", null=True)
    email = models.TextField("邮箱地址", max_length=500, null=True)
    email_password = models.TextField("邮箱地址", max_length=500, null=True)
    create_time = models.DateTimeField("创建时间", auto_now=True)
    update_time = models.DateTimeField("更新时间", auto_now=True)

    def __str__(self):
        return self.username

